package ae.pcfc.cldos.online.common.clddb.domain;

import java.io.Serializable;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.envers.Audited;

import ae.pcfc.cldos.online.common.domain.BaseEntity;


/**
 * The persistent class for the T_CLDOS_APPLICATION_STATUS database table.
 * 
 */
@Entity
@Table(name="T_CLDOS_APPLICATION_STATUS")
@Audited
public class ApplicationStatus  extends BaseEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	public static final Long UNKNOWN_STATUS = -1l;
	public static final Long STATUS_INITIATED = 1l;
	public static final Long STATUS_APPROVED_BY_ONLINE_ADMIN = 2l;
	public static final Long STATUS_REJECTED_BY_ONLINE_ADMIN = 3l;
	public static final Long STATUS_APPROVED_BY_GENERAL_ADMIN = 4l;
	public static final Long STATUS_REJECTED_BY_GENERAL_ADMIN = 5l;
	public static final Long STATUS_RESUBMITED = 0l;
	public static final Long PAYMENT_RENEWAL = 6l;
	public static final Long PAYMENT_CANCELATION = 7l;
	public static final Long STATUS_CANCELED_BY_ONLINE_ADMIN = 12l;
	public static final Long STATUS_CANCELED_BY_GENERAL_ADMIN = 13l;
	public static final Long STATUS_CANCELED_ON_RESUBMITION = 14l;
	public static final Long STATUS_EXIT_PAPER_SUBMIT = 15l;
	public static final Long STATUS_EXIT_PAPER_SUBMITED = 16l;
	public static final Long STATUS_COMPLETED = 20l;
	
	public static final Set<Long> PENDING_STATUSES = new HashSet<Long>(){
		/**
		 * 
		 */
		private static final long serialVersionUID = 7923835259493762354L;

		{
			add(STATUS_INITIATED);
			add(STATUS_APPROVED_BY_ONLINE_ADMIN);
			add(STATUS_RESUBMITED);
		}
	};

	public static final String __STATUS_TYPE = "statusType";
	public static final String __STATUS_CODE = "statusCode";

	public static final Long PAYMENT_RENEWAL_COMPLETED = 8l;
	public static final Long PAYMENT_CANCELATION_COMPLETED = 9l;

	
	public static final String __STATUS_ONLINE = "ONLINE";
	public static final String __STATUS_OFFLINE = "OFFLINE";
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="STATUS_CODE")
	private Long statusCode;

	@Column(name="STATUS_DESC")
	private String statusDesc;

	@Column(name="STATUS_TYPE")
	private String statusType;

	//bi-directional many-to-one association to AppMetaData
	@OneToMany(mappedBy="ApplicationStatus")
	private List<AppMetaData> AppMetaData;
	
	/*//bi-directional many-to-one association to ReviewComments
	@OneToMany(mappedBy="applicationStatus")
	private List<ReviewComments> reviewComments;*/

	//bi-directional many-to-one association to MessageInbox
	@OneToMany(mappedBy="ApplicationStatus")
	private List<MessageInbox> MessageInboxs;

    public ApplicationStatus() {
    }

	public Long getStatusCode() {
		return this.statusCode;
	}

	public void setStatusCode(Long statusCode) {
		this.statusCode = statusCode;
	}

	public String getStatusDesc() {
		return this.statusDesc;
	}

	public void setStatusDesc(String statusDesc) {
		this.statusDesc = statusDesc;
	}

	public String getStatusType() {
		return this.statusType;
	}

	public void setStatusType(String statusType) {
		this.statusType = statusType;
	}

	public List<AppMetaData> getAppMetaData() {
		return this.AppMetaData;
	}

	public void setAppMetaData(List<AppMetaData> AppMetaData) {
		this.AppMetaData = AppMetaData;
	}
	
	public List<MessageInbox> getMessageInboxs() {
		return this.MessageInboxs;
	}

	public void setMessageInboxs(List<MessageInbox> MessageInboxs) {
		this.MessageInboxs = MessageInboxs;
	}

/*	public List<ReviewComments> getReviewComments() {
		return reviewComments;
	}

	public void setReviewComments(List<ReviewComments> reviewComments) {
		this.reviewComments = reviewComments;
	}*/
	
}